<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Get the Unicode name for a property value</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="intlchar.getpropertyvalueenum.html">« IntlChar::getPropertyValueEnum</a></li>
      <li style="float: right;"><a href="intlchar.getunicodeversion.html">IntlChar::getUnicodeVersion »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.intlchar.html">IntlChar</a></li>
    <li>Get the Unicode name for a property value</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="intlchar.getpropertyvaluename" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">IntlChar::getPropertyValueName</h1>
  <p class="verinfo">(PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">IntlChar::getPropertyValueName</span> &mdash; <span class="dc-title">Get the Unicode name for a property value</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-intlchar.getpropertyvaluename-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><strong>IntlChar::getPropertyValueName</strong></span>(<span class="methodparam"><span class="type">int</span> <code class="parameter">$property</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$value</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$type</code><span class="initializer"> = IntlChar::LONG_PROPERTY_NAME</span></span>): <span class="type"><span class="type">string</span>|<span class="type"><span class="type false">false</span></span></span></div>

  <p class="para rdfs-comment">
   Returns the Unicode name for a given property value, as given in the Unicode database file PropertyValueAliases.txt.
  </p>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <p class="para">
    Some of the names in PropertyValueAliases.txt can only be retrieved using
    <strong><code>IntlChar::PROPERTY_GENERAL_CATEGORY_MASK</code></strong>, not
    <strong><code>IntlChar::PROPERTY_GENERAL_CATEGORY</code></strong>.
    These include:
    <ul class="simplelist">
     <li class="member">&quot;C&quot; / &quot;Other&quot;</li>
     <li class="member">&quot;L&quot; / &quot;Letter&quot;</li>
     <li class="member">&quot;LC&quot; / &quot;Cased_Letter&quot;</li>
     <li class="member">&quot;M&quot; / &quot;Mark&quot;</li>
     <li class="member">&quot;N&quot; / &quot;Number&quot;</li>
     <li class="member">&quot;P&quot; / &quot;Punctuation&quot;</li>
     <li class="member">&quot;S&quot; / &quot;Symbol&quot;</li>
     <li class="member"> &quot;Z&quot; / &quot;Separator&quot;</li>
    </ul>
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-intlchar.getpropertyvaluename-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
<code class="parameter">property</code></dt>

    <dd>

     <p class="para">The Unicode property to lookup (see the <code class="literal">IntlChar::PROPERTY_*</code> constants).</p>
     <p class="para">
      If out of range, or this method doesn&#039;t work with the given value, <strong><code>false</code></strong> is returned.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">value</code></dt>

    <dd>

     <p class="para">
      Selector for a value for the given property. If out of range, <strong><code>false</code></strong> is returned.
     </p>
     <p class="para">
      In general, valid values range from <code class="literal">0</code> up to some maximum. There are a couple exceptions:
      <ul class="simplelist">
       <li class="member">
        <strong><code>IntlChar::PROPERTY_BLOCK</code></strong> values begin at the non-zero value <strong><code>IntlChar::BLOCK_CODE_BASIC_LATIN</code></strong>
       </li>
       <li class="member">
        <strong><code>IntlChar::PROPERTY_CANONICAL_COMBINING_CLASS</code></strong> values are not contiguous and range from 0..240.
       </li>
      </ul>
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">type</code></dt>

    <dd>

     <p class="para">
      Selector for which name to get. If out of range, <strong><code>false</code></strong> is returned.
     </p>
     <p class="para">
      All values have a long name. Most have a short name, but some do not. Unicode allows for additional names;
      if present these will be returned by adding 1, 2, etc. to <strong><code>IntlChar::LONG_PROPERTY_NAME</code></strong>.
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-intlchar.getpropertyvaluename-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the name, or <strong><code>false</code></strong> if either the <code class="parameter">property</code> or the <code class="parameter">type</code>
   is out of range. Returns <strong><code>null</code></strong> on failure.
  </p>
  <p class="para">
   If a given <code class="parameter">type</code> returns <strong><code>false</code></strong>, then all larger values of <code class="parameter">type</code>
   will return <strong><code>false</code></strong>, with one exception: if <strong><code>false</code></strong> is returned for <strong><code>IntlChar::SHORT_PROPERTY_NAME</code></strong>,
   then <strong><code>IntlChar::LONG_PROPERTY_NAME</code></strong> (and higher) may still return a non-<strong><code>false</code></strong> value.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-intlchar.getpropertyvaluename-examples">
  <h3 class="title">范例</h3>
  <div class="example" id="example-2512">
   <p><strong>示例 #1 Testing different properties</strong></p>
   <div class="example-contents">
    <div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">getPropertyValueName</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">PROPERTY_BLOCK</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">BLOCK_CODE_GREEK</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">getPropertyValueName</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">PROPERTY_BLOCK</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">BLOCK_CODE_GREEK</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">SHORT_PROPERTY_NAME</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">getPropertyValueName</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">PROPERTY_BLOCK</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">BLOCK_CODE_GREEK</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">LONG_PROPERTY_NAME</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">getPropertyValueName</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">PROPERTY_BLOCK</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">BLOCK_CODE_GREEK</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">IntlChar</span><span style="color: #007700">::</span><span style="color: #0000BB">LONG_PROPERTY_NAME&nbsp;</span><span style="color: #007700">+&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

   <div class="example-contents"><p>以上例程会输出：</p></div>
   <div class="example-contents screen">
    <div class="cdata"><pre>
string(16) &quot;Greek_And_Coptic&quot;
string(5) &quot;Greek&quot;
string(16) &quot;Greek_And_Coptic&quot;
bool(false)
</pre></div>
   </div>
  </div>
 </div>


</div></div></div></body></html>